﻿using System;

namespace LibraryGuard.Interfaces
{
	/// <summary>
	/// Interface for values.
	/// </summary>
	public interface IValue
	{
		/// <summary>
		/// Gets original type.
		/// </summary>
		/// <param name="data"></param>
		/// <returns></returns>
		TypeCode GetBaseType(IDataProvider data);

		/// <summary>
		/// Checks, if selected value can be converted to specified type.
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		bool CanBeConvertedTo(TypeCode type, IDataProvider data);

		/// <summary>
		/// Gets value converted to specified type.
		/// </summary>
		/// <param name="type"></param>
		/// <returns></returns>
		object GetValue(TypeCode type, IDataProvider data);
	}
}
